package br.com.statizo.financeiro.swt.filter;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.List;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TabFolder;
import org.snoghertframework.swt.annotations.FilterComponent;
import org.snoghertframework.swt.filter.ApplicationFilter;
import org.snoghertframework.swt.util.impl.LayoutUtil;
import org.springframework.beans.factory.annotation.Autowired;


@FilterComponent(description="Criando componente de Calendário")
public class CreateCalendarFilter implements ApplicationFilter{

	
	@Autowired
	private TabFolder tabFolder;
	
	@Autowired
	private LayoutUtil layoutUtil;
	
	@Autowired
	private Shell shell;
	
	
	@Override
	public void doFilter() {

		
		 shell.setLayout(new FormLayout());

		 layoutUtil.setFormLayout(tabFolder);
		 layoutUtil.setFormData(tabFolder, 10, 0, 100, 100);
		
		 Group group = new Group(tabFolder,SWT.NONE);
		 layoutUtil.setFormLayout(group);
		 layoutUtil.setFormData(group, 5, 5, 20, 90);
		 group.setText("Período");
		 
		 List calendarList = new List(group, SWT.NONE | SWT.SINGLE);
		 layoutUtil.setFormData(calendarList, 2, 2, 98, 98);
		 calendarList.setItems(new String[]{"Item 1","Item 2"});
		
		
	}

}
